package com.quzitech.efest.handle;

import java.util.Calendar;

import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;

public abstract class NoDoubleClickListener implements OnClickListener {

	public static final int MIN_CLICK_DELAY_TIME = 1500;
	private long lastClickTime = 0;

	public abstract void onNoDoubleClick(View view);

	@Override
	public void onClick(View v) {
		long currentTime = Calendar.getInstance().getTimeInMillis();
		if (currentTime - lastClickTime > MIN_CLICK_DELAY_TIME) {
			lastClickTime = currentTime;
			onNoDoubleClick(v);
		} else {
			Log.v("sleep", "clicknosuccess");
		}
	}

}
